import java.util.Scanner;
public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        BankAccount account1 = new BankAccount();

        BankAccount account2 = new BankAccount();

        account1.balance=1000;

        account2.balance=500;

        account1.deposit(sc.nextInt());

        account1.withdraw(sc.nextInt());

        account1.transfer(sc.nextInt(), account2);

        System.out.println(account1.balance+" "+account2.balance);
    }
}
class BankAccount{
    double balance;
    public void deposit(double amount){
        balance += amount;
    }
    public boolean withdraw(double amount){
        if(balance >= amount){
            balance -= amount;
            return true;
        }else{
            return false;
        }
    }
    public boolean transfer(double amount,BankAccount anotherAccount){
        if(balance >= amount){
            withdraw(amount);
            anotherAccount.deposit(amount);
            return true;
        }else{
            return false;
        }
    }
}
